package com.itheima.domain;


import com.itheima.controller.GroupA;
import com.sun.xml.internal.ws.wsdl.writer.document.http.Address;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

public class User {
    @NotBlank(message = "姓名不能为空", groups = {GroupA.class})
    private String username;
    @NotNull(message = "请输入年龄")
    @Max(value = 60, message = "年龄最大不超过过60岁")
    @Min(value = 18, message = "年龄最小大于18岁")
    private int age;
    private String pic;//头像文件名称
    @Valid
    private Address address;

    public String getPic() {
        return pic;
    }

    public void setPic(String pic) {
        this.pic = pic;
    }

    public String getUsername() {
        return username;
    }

    public Address getAddress() {
        return address;
    }

    public void setAddress(Address address) {
        this.address = address;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "User{" +
                "username='" + username + '\'' +
                ", age=" + age +
                ", pic='" + pic + '\'' +
                ", address=" + address +
                '}';
    }
}
